<?php
/**
 * The template for displaying the header.
 *
 * Contains the opening of the id=page which is closed 
 * in footer template, just before body itself closes.
 *
 * @package Behold
 * @since Behold 1.0.0
 */
?>

<!doctype html>
<html <?php language_attributes();?>>

<head>
<title>
	<?php
	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );
	?>
</title>
	
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php echo get_stylesheet_uri(); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<?php
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	 */
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>

</head>
<body <?php body_class(); ?>>

<div id="header" class="group">

<div id="social-media" class="group">
		<?php $social_options = get_option ( 'behold_theme_social_options' ); ?>
		
		
		<?php
		if ( !isset($social_options['facebook']) ) {
			$social_options['facebook'] = '';
		} else {
			echo $social_options['facebook'] ? '<a href="' . $social_options['facebook'] . '" class="behold-fb" title="' . __('I am on Facebook!', 'Behold') . '"><span class="hidethis">'. __('Facebook', 'Behold') .'</span></a>' : '';
		} ?> 
		<?php 
		if ( !isset($social_options['twitter']) ) {
			$social_options['twitter'] = '';
		} else {
			echo $social_options['twitter'] ? '<a href="' . $social_options['twitter'] . '" class="behold-tw" title="' . __('Follow me on Twitter!','Behold') . '"><span class="hidethis">'. __('Twitter', 'Behold') .'</span></a>' : ''; 
		} ?>   
		<?php 
		if ( !isset($social_options['googleplus']) ) {
			$social_options['googleplus'] = '';
		} else {
			echo $social_options['googleplus'] ? '<a href="' . $social_options['googleplus'] . '" class="behold-gp" title="' . __('I am on Google+', 'Behold') . '"><span class="hidethis">'. __('Google+', 'Behold') .'</span></a>' : ''; 
		} ?>
		<?php 
		if ( !isset($social_options['pinterest']) ) {
			$social_options['pinterest'] = '';
		} else {
			echo $social_options['pinterest'] ? '<a href="' . $social_options['pinterest'] . '" class="behold-pi" title="' . __('I am on Pinterest!','Behold') . '"><span class="hidethis">'. __('Pinterest', 'Behold') .'</span></a>' : ''; 
		} ?>
		<?php 
		if ( !isset($social_options['linkedin']) ) {
			$social_options['linkedin'] = '';
		} else {
			echo $social_options['linkedin'] ? '<a href="' . $social_options['linkedin'] . '" class="behold-li" title="' . __('See my professional network on LinkedIn','Behold') . '"><span class="hidethis">'. __('LinkedIn', 'Behold') .'</span></a>' : ''; 
		} ?>
		<?php 
		if ( !isset($social_options['rss']) ) {
			$social_options['rss'] = '';
		} else {
			echo $social_options['rss'] ? '<a href="' . $social_options['rss'] . '" class="behold-rs" title="' . $social_options['rss'] . '"><span class="hidethis">'. __('RSS Feeds', 'Behold') .'</span></a>' : ''; 
		} ?>
</div>
	<?php if ( has_nav_menu( 'header-menu' ) ) {
		# An optional header navigation menu.
	?>	
		<div id="access" role="navigation">
		
			<a href="#" id="access-responsive" tabindex="0" title="<?php esc_attr_e("Menu", 'Behold');?>"> <span class="hidethis">hide</span> </a>
	
	<?php
		wp_nav_menu( array( 
				'theme_location' => 'header-menu',
				'before'          => '',
				'after'           => '',
				'container_class' => '',
				'container'       => '',
				'menu_id'         => '',
				'items_wrap'      => '<ul>%3$s</ul>',
			)
		);
	?>
		</div> <!-- close of id="access" -->
	<?php } # Close of has_nav_menu() ?>
	
	<div id="blog-title-wrap" class="group">
		<h1 id="blog-title"> 	
			<a href="<?php echo site_url();?>">
				<?php bloginfo( 'name' );?>	
			</a>	
		</h1>
		<?php
			$site_description = get_bloginfo( 'description', 'display' );
			if ( $site_description ) : 
		?> 
			<div id="blog-desc">
				<p><?php echo $site_description;?></p>
			</div>	<!-- close of id="blog-desc" -->
		<?php endif; ?>
	</div>	 <!-- close of id="blog-title-wrap"  -->
	
	<?php 
		if ( is_singular() && has_post_thumbnail( $post->ID )  ) {
	?>
		<a href="<?php echo esc_url( home_url( '/' ) );  ?>"><?php echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );?></a>
		<?php 
			# Assume the size of Featured Image, aka, post thumbnail is same as that of custom header size!
			# If not, overflow is hidden.
		}
		else { 
			# Display the default _custom_ header image, if no post thumbnail was chosen. 
			$header_image = get_header_image();
		?>			
		<div id="header-featured-img">
			<?php if ( $header_image ) : ?>
			<li id="header-li">
				<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
					<img id="header-img" src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />	
				</a>
			</li>
			<?php endif;?>
			<?php get_template_part( 'content', 'slidingposts' );
		echo "</div>"; # Close of id="header-featured-img
	
		} # Close of is_singular && ....		
	?>
			
	
	<!-- A scroll to easer -->
	<div style="display: block;" class="scroll_to_top" title="<?php esc_attr_e('Click to scroll to top of page', 'Behold');?>">
	</div>
	
</div> <!-- close of id="header" -->
<div id="mimba">